Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge case defect when importing the first test node into dashboard #763

Merged

Conversation

oidebrett
Copy link
Contributor

Fixed for an edge case defect/bug when importing the first test node using the dashboard via a diagnostics file.

Procedure to replicate bug:

  1. run the python matter server (no matter nodes commissioned)
  2. run the dashboard node app
  3. attempted to try to import a device diagnostic file
  4. the dashboard throws an error in device_controller.py file

File "/home/XXX/Projects/pip-python-matter-server/venv/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 857, in import_test_node next_test_node_id = max(*(x for x in self._nodes), TEST_NODE_START) + 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'int' object is not iterable

Fix for defect:

In the "import_test_node" function in device_controller.py, a check was coded for an empty dict for self._nodes and if empty set the next_test_node_id to TEST_NODE_START

@marcelveldt marcelveldt added the bugfix Pull request that fixes a (known) issue/bug label Jun 18, 2024
Copy link
Contributor

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@marcelveldt marcelveldt merged commit 950663f into home-assistant-libs:main Jun 18, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a (known) issue/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants